<template>
  <div class="pinkfair">
    <ul>
      <li v-for="(item, index) in pinkfair" :key="index">
        <div class="discount">{{ item.mark }}</div>
        <img :src="item.img_url" />
        <div class="title">{{ item.title }}</div>
        <div class="price-box">
          <h4 class="newPrice">￥{{ item.sale_price }}</h4>
          <del class="oldPrice">￥{{ item.market_price }}</del>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    pinkfair: {
      type: Array,
      default: () => [],
    },
  },
  data() {
    return {
      index: "",
    };
  },
};
</script>

<style lang="scss">
.pinkfair {
  width: 730px;
  //   height: 252px;
  padding: 5px 10px;
  ul {
    display: flex;
    background: linear-gradient(
      to right,
      rgb(255, 195, 219),
      rgb(255, 195, 219)
    );
    border-radius: 10px;
    padding: 6px;
    li {
      margin: 2px 2px 0 2px;
      padding-bottom: 2px;
      background: rgb(255, 255, 255);
      border-radius: 4px;
      flex: 1;
      .discount {
        background: rgb(242, 141, 181);
        color: rgb(255, 255, 255);
        height: 18px;
        line-height: 18px;
        border-radius: 4px 4px 0 0;
        font-size: 12px;
        text-align: center;
        width: 100%;
        z-index: 5;
      }
      img {
        width: 100%;
      }
      .title {
        color: rgb(99, 99, 99);
        font-size: 12px;
        padding: 3px 3px 5px 3px;
        height: 30px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
      }
      .price-box {
        background: rgb(239, 90, 82);
        height: 18px;
        border-radius: 9px;
        padding: 0 5px;
        display: flex;
        justify-content: space-between;
        margin: 0 3px;
        .newPrice {
          color: rgb(255, 255, 255);
          font-size: 12px;
          font-weight: 700;
        }
        .oldPrice {
          color: rgb(255, 255, 255);
          font-size: 12px;
        }
      }
    }
  }
}
</style>